import pytest,yagmail,os
from yuekao.log_set import log_weidu

if __name__ == '__main__':
    log_weidu()
    pytest.main(['test_A3mall.py','-s','--clean-alluredir','--alluredir=./reportdata'])
    os.system('allure generate ./reportdata -o ./htmlreport --clean')


    def send_mail(filename):
        mail=yagmail.SMTP(user='2018675435@qq.com',password='nnqakcckuzyqfebd',host='smtp.qq.com')
        mail.send(to="2018675435@qq.com",
        subject="维度电商系统接口测试报告",
        contents="请查收",
        attachments=filename)
    send_mail(['weidudiansanglog.txt','./htmlreport/index.html'])# 发送邮件






















